/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.park.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 企业事故事件
 *
 * @author pig
 * @date 2023-10-25 14:43:06
 */
@Data
@TableName("base_accident_event")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "企业事故事件")
public class BaseAccidentEventEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 发生时间
     */
    @Schema(description = "发生时间")
    private Date accidentTime;

    /**
     * 事故发生方
     */
    @Schema(description = "事故发生方")
    private String accidentSource;

    /**
     * 事故类型
     */
    @Schema(description = "事故类型")
    private String accidentType;

    /**
     * 事故等级
     */
    @Schema(description = "事故等级")
    private String accidentLevel;

    /**
     * 事故情况
     */
    @Schema(description = "事故情况")
    private String accidentDetail;

    /**
     * 事故状态
     */
    @Schema(description = "事故状态")
    private String accidentStatus;

    /**
     * 事故名称
     */
    @Schema(description = "事故名称")
    private String accidentName;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 附件
     */
    @Schema(description = "附件")
    private String attachment;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

    public String getAccidentSourceStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.accident_source, this.accidentSource);
    }

    public String getAccidentTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.accident_type, this.accidentType);
    }

    public String getAccidentLevelStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.accident_level, this.accidentLevel);
    }

    public String getAccidentStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.accident_status, this.accidentStatus);
    }


}
